<%@ page contentType="text/html;charset=UTF-8"%>
<%@include file="module/common.jsp"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="description" content="cosmo云工厂">
    <meta name="Keywords" content="cosmo,cosmo云工厂">
    <title>cosmo云工厂</title>
    <link href="${ctxStatic}/cloudfactory/css/basic.css" rel="stylesheet" type="text/css" />
    <link href="${ctxStatic}/cloudfactory/css/main.css" rel="stylesheet" type="text/css" />
        <link href="${ctxStatic}/cloudfactory/css/flex.css" rel="stylesheet" type="text/css" />
    <link href="${ctxStatic}/cloudfactory/css/cloudFoundry.css" rel="stylesheet" type="text/css" />
    <!–[if lt IE9]>
    <script src="${ctxStatic}/cloudfactory/js/html5.js"></script>
    <![endif]–>
</head>

<body>
<div class="sys_warp">
    <!--header开始-->
    <jsp:include page="module/userCenterhead.jsp" flush="true" />
    
    <!--banner结束,主体开始-->
   

            
            <div class="background">
                <div class="titleTextBackground displayTable absolute-left-center-top-self-center height90">
                    <a href="myOrder.html" class="orderTitle choose">
                        我的订单
                    </a>
                    <a href="" onclick="javascript:alert('功能开发中')" class="orderTitle">
                        续费管理
                    </a>
                    <a href="" onclick="javascript:alert('功能开发中')" class="orderTitle">
                        合同发票
                    </a>
                </div>
                <div class="titleTextBackground2">
                    <img class="titleTextBackgroundImg1" src="${ctxStatic}/cloudfactory/img/shoppingCart/titleTextBackground.png" alt="">
                    <img class="titleTextBackgroundImg2 absolute-self-center" src="${ctxStatic}/cloudfactory/img/myOrder/icon.png" alt="">
                    <p class="titleText1 absolute-self-top-center">MY<span>&ensp;ORDER</span></p>
                    <p class="titleText2 absolute-self-top-center">我的订单</p>
                    <img class="titleTextLine" src="${ctxStatic}/cloudfactory/img/shoppingCart/line.png" alt="">
                    <div class="rightMenu absolute-self-center">
                        <div class="gouWuChe2">
                            <img src="${ctxStatic}/cloudfactory/img/shoppingCart/gouWuChe2.png" alt="">
                        </div>
                        <div class="customer">
                            <p>客服</p>
                        </div>
                        <div class="help">
                            <p>帮助</p>
                        </div>
                    </div>
                </div>

                <div class="tableAllBox marginTop40">
                    <div class="tableBoxNavigation1">
                        <div class="buttonTab obligation choose1">
                            <p>待支付</p>
                        </div>
                        <div class="buttonTab allOrder">
                            <p>全部</p>
                        </div>
                        <div class="myOrderRightTitle">
                            <div class="createTime">
                                <p>创建时间</p>
                            </div>
                            <div id="dateSelect" class="dateSelect">
                                <p>全部</p>
                                <img src="${ctxStatic}/cloudfactory/img/shoppingList/triangle.png" alt="">
                            </div>
                            <div class="dateSelect">
                                <input id="search_text" class="searchInput" type="text" name="searchInput" value="" >
                                <img src="${ctxStatic}/cloudfactory/img/myOrder/search.png" alt="">
                            </div>
                            <div class="orderSearch">
                                <p>搜索</p>
                            </div>
                        </div>
                        <div id="auto_div" class=""></div>
                    </div>
                    <table id="tableTitle">
                        <tr>
                            <th class="tableOrderTitle2">订单号</th>
                            <th class="tableOrderTitle3">功能</th>
                            <th class="tableOrderTitle3">功能名称</th>
                            <th class="tableOrderTitle5">创建时间</th>
                            <th class="tableOrderTitle6">订单失效时间</th>
                            <th class="tableOrderTitle3">订单状态</th>
                            <th class="tableOrderTitle8">工厂名称</th>
                            <th class="tableOrderTitle3">订单金额</th>
                            <th class="tableOrderTitle10">操作</th>
                            <th class="tableOrderTitle11">&emsp;&emsp;</th>
                        </tr>
                    </table>
                    <div class="tableBox">
                    
                    
                    
                    

                    
                    
                    
                        <div class="tableOrderBox">
                            <div class="tableproductBox">
                                <div class="borderLine absolute-left-center"></div>
                               
                                <table class="tableproduct" id="contentTable">
                                    
                                 
                                   <c:forEach items="${count}" var="c"> 
                             <c:forEach items="${orders}" var="o">
                             <c:if test="${o.orderNo==c.orderNo }">
									<tr class="tableproductTr">
									
										<td class="tableOrderTitle0">${o.orderNo }</td>
										<td class="tableOrderTitle3">${o.menuName }</td>
										
										<td class="tableOrderTitle3"><c:choose>
												<c:when test="${o.isRequired ==0}">
基础功能
</c:when>
												<c:otherwise>
							选配功能
							</c:otherwise>
											</c:choose></td>
										<td class="tableOrderTitle5"> <fmt:formatDate value="${o.createDate }" pattern="yyyy-MM-dd" ></fmt:formatDate></td>
										<td class="tableOrderTitle6"> <fmt:formatDate value="${o.overDate }" pattern="yyyy-MM-dd" ></fmt:formatDate></td>
										<td class="tableOrderTitle3">${fns:getDictLabel(o.status, 'audit_status', '')}</td>
										<td class="tableOrderTitle8">${o.plant }</td>
										<td class="tableOrderTitle3">${o.totalMoney }</td>
										
										<td class="tableOrderTitle10">
										<c:choose>
												<c:when test="${o.status ==3}">
<input value="提交" onclick="look('${o.orderNo }')"  type="button">
</c:when>
												<c:otherwise>
							<input value="支付/删除" type="button">
							</c:otherwise>
											</c:choose>
										
										</td>
									</tr>
</c:if>
								</c:forEach>      
                                    <tr class="tableproductTr">
                            <th class="tableOrderTitle2"> </th>
                            <th class="tableOrderTitle3"> </th>
                            <th class="tableOrderTitle3"> </th>
                            <th class="tableOrderTitle5"> </th>
                            <th class="tableOrderTitle6"> </th>
                            <th class="tableOrderTitle3"> </th>
                            <th class="tableOrderTitle8"> </th>
                            <th class="tableOrderTitle3"> </th>
                            <th class="tableOrderTitle10"> </th>
                                    </tr>
                                    </c:forEach>  
                                </table>
                                    
                                  
                            </div>
                            

                        </div>
                        
                    </div>
                    <div class="informationMaintenance">
                        <a href="#">
                            <img src="${ctxStatic}/cloudfactory/img/myOrder/export.png" alt="">
                            <p>导出订单</p>
                        </a>
                    </div>
                </div>
    <!--主体结束,footer开始-->
    <jsp:include page="module/foot.jsp" flush="true" />
    <!--footer结束-->
</div>
</body>
<script type="text/javascript" src="${ctxStatic}/cloudfactory/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/cloudfactory/js/main.js"></script>
<script>

	function look(orderNo) {
		
		window.location.href="${ctx}/order/lookBuyCar?orderNo="+orderNo;
	}

$(document).ready(function() {
	uniteTable();
});

/////////////////////////////////////////////// 
//功能：合并表格 
//参数：tb－需要合并的表格ID 
//参数：colLength－－需要对前几列进行合并，比如， 
//想合并前两列，后面的数据列忽略合并，colLength应为2 
//缺省表示对全部列合并 
//data:2011.11.06 
/////////////////////////////////////////////// 
function uniteTable() {
	var colLength = 2;
	var tb = document.getElementById("contentTable");
	//检查表格是否规整 
	if (!checkTable(tb))
		return;
	var i = 0;
	var j = 0;
	var rowCount = tb.rows.length; //行数 
	var colCount = tb.rows[0].cells.length; //列数 
	var obj1 = null;
	var obj2 = null;
	//为每个单元格命名 
	for (i = 0; i < rowCount; i++) {
		for (j = 0; j < colCount; j++) {
			tb.rows[i].cells[j].id = "tb__" + i.toString() + "_"
					+ j.toString();
		}
	}
	//逐列检查合并 
	for (i = 0; i < colCount; i++) {
		if (i == colLength)
			return;
		obj1 = document.getElementById("tb__0_" + i.toString())
		for (j = 1; j < rowCount; j++) {
			obj2 = document.getElementById("tb__" + j.toString() + "_"
					+ i.toString());
			if (obj1.innerText == obj2.innerText) {
				obj1.rowSpan++;
				obj2.parentNode.removeChild(obj2);
			} else {
				obj1 = document.getElementById("tb__" + j.toString() + "_"
						+ i.toString());
			}
		}
	}
	for (i = 4; i < 10; i++) {
		if (i == 10)
			return;
		obj1 = document.getElementById("tb__0_" + i.toString())
		for (j = 1; j < rowCount; j++) {
			obj2 = document.getElementById("tb__" + j.toString() + "_"
					+ i.toString());
			if (obj1.innerText == obj2.innerText) {
				obj1.rowSpan++;
				obj2.parentNode.removeChild(obj2);
			} else {
				obj1 = document.getElementById("tb__" + j.toString() + "_"
						+ i.toString());
			}
		}
	}
}

///////////////////////////////////////// 
//功能：检查表格是否规整 
//参数：tb－－需要检查的表格ID 
//data: 2011.11.06
///////////////////////////////////////// 
function checkTable(tb) {
	if (tb.rows.length == 0)
		return false;
	if (tb.rows[0].cells.length == 0)
		return false;
	for (var i = 0; i < tb.rows.length; i++) {
		if (tb.rows[0].cells.length != tb.rows[i].cells.length)
			return false;
	}
	return true;
}
    $(function(){
        indexInit();
    });
</script>
</html>